<?php

namespace app\index\model;

use think\Db;
use think\db\Query;
use app\index\model\Base;

class Index extends Base
{

    
    
    // 根据获取推荐文章信息
    public function getposts()
    {
         $data = Db::view('post','id,title,sendTime,content,desc,count,thumbs')
            ->view('user','name,pic','user.id=post.uid')
            ->select();
        // var_dump($data);die;
        return $data;
    }

    // 获取分类信息
    public function getlabel()
    {
        $data = db('label')->select();
        return $data;
    }

     // id获取频道信息
    public function getchannel($id='')
    {
        $data = db('Channel')
        ->find($id);
        return $data;
    }


}
